home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume7 / nethack3 / patch4c < prev    next >
Encoding:
Internet Message Format  |  1989-10-02  |  49.9 KB

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v08i039:  NetHack3 -  display oriented dungeons & dragons (Ver. 3.0), Patch4c
  5. Message-ID: <4629@tekred.CNA.TEK.COM>
  6. Date: 29 Sep 89 21:09:22 GMT
  7. Sender: nobody@tekred.CNA.TEK.COM
  8. Lines: 1917
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Izchak Miller <izchak@linc.cis.upenn.edu>
  12. Posting-number: Volume 8, Issue 39
  13. Archive-name: NetHack3/Patch4c
  14. Patch-To: NetHack3: Volume 7, Issue 56-93
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of archive 3 (of 11)."
  23. # Contents:  patches04c
  24. # Wrapped by billr@saab on Fri Sep 29 13:13:48 1989
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f 'patches04c' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'patches04c'\"
  28. else
  29. echo shar: Extracting \"'patches04c'\" \(47374 characters\)
  30. sed "s/^X//" >'patches04c' <<'END_OF_FILE'
  31. X*** src/Old/mkroom.c    Wed Sep 27 11:53:40 1989
  32. X--- src/mkroom.c    Thu Sep 14 14:36:01 1989
  33. X***************
  34. X*** 296,303 ****
  35. X          for(sx = sroom->lx; sx <= sroom->hx; sx++)
  36. X          for(sy = sroom->ly; sy <= sroom->hy; sy++)
  37. X          if(!OBJ_AT(sx, sy) && levl[sx][sy].gmask == 0 &&
  38. X!            levl[sx][sy].mmask == 0 &&
  39. X!            !t_at(sx,sy) && !nexttodoor(sx,sy)) {
  40. X              if((sx+sy)%2) {
  41. X              levl[sx][sy].typ = POOL;
  42. X              levl[sx][sy].scrsym = POOL_SYM;
  43. X--- 296,302 ----
  44. X          for(sx = sroom->lx; sx <= sroom->hx; sx++)
  45. X          for(sy = sroom->ly; sy <= sroom->hy; sy++)
  46. X          if(!OBJ_AT(sx, sy) && levl[sx][sy].gmask == 0 &&
  47. X!            !MON_AT(sx, sy) && !t_at(sx,sy) && !nexttodoor(sx,sy)) {
  48. X              if((sx+sy)%2) {
  49. X              levl[sx][sy].typ = POOL;
  50. X              levl[sx][sy].scrsym = POOL_SYM;
  51. X***************
  52. X*** 324,330 ****
  53. X  
  54. X      if(!place_oracle(sroom,&dy,&xx,&yy)) return;
  55. X  
  56. X!     if(levl[xx][yy].mmask) rloc(m_at(xx, yy)); /* insurance */
  57. X  
  58. X      /* set up Oracle and environment */
  59. X      if(!(oracl = makemon(&mons[PM_ORACLE],xx,yy))) return;
  60. X--- 323,330 ----
  61. X  
  62. X      if(!place_oracle(sroom,&dy,&xx,&yy)) return;
  63. X  
  64. X!     if(MON_AT(xx, yy))
  65. X!         rloc(m_at(xx, yy)); /* insurance */
  66. X  
  67. X      /* set up Oracle and environment */
  68. X      if(!(oracl = makemon(&mons[PM_ORACLE],xx,yy))) return;
  69. X*** src/Old/mon.c    Wed Sep 27 11:54:07 1989
  70. X--- src/mon.c    Mon Sep 25 21:35:03 1989
  71. X***************
  72. X*** 8,13 ****
  73. X--- 8,17 ----
  74. X  #  include "artifact.h"
  75. X  #endif
  76. X  
  77. X+ #ifdef WORM
  78. X+ #  include "wseg.h"
  79. X+ #endif
  80. X+ 
  81. X  #ifdef HARD
  82. X  static boolean restrap();
  83. X  #  include <ctype.h>
  84. X***************
  85. X*** 17,23 ****
  86. X  int lastwarnlev;
  87. X  static const char *warnings[] = {
  88. X      "white", "pink", "red", "ruby", "purple", "black" };
  89. X! struct monst *fdmon;    /* chain of dead monsters, need not to be saved */
  90. X  
  91. X  /* Creates a monster corpse, a "special" corpse, or nothing if it doesn't
  92. X   * leave corpses.  Monsters which leave "special" corpses should have
  93. X--- 21,27 ----
  94. X  int lastwarnlev;
  95. X  static const char *warnings[] = {
  96. X      "white", "pink", "red", "ruby", "purple", "black" };
  97. X! struct monst *fdmon;    /* chain of dead monsters, need not be saved */
  98. X  
  99. X  /* Creates a monster corpse, a "special" corpse, or nothing if it doesn't
  100. X   * leave corpses.  Monsters which leave "special" corpses should have
  101. X***************
  102. X*** 112,123 ****
  103. X      /* All special cases should precede the G_NOCORPSE check */
  104. X  
  105. X      /* Note: oname() cannot be used generically for non-inventory objects
  106. X!      * unless you fix the link from the previous object in the chain.
  107. X       * (Here we know it's the first one, so there was no link.)
  108. X       */
  109. X      if (mtmp->mnamelth) {
  110. X          obj = oname(obj, NAME(mtmp), 0);
  111. X          fobj = obj;
  112. X      }
  113. X      stackobj(fobj);
  114. X      newsym(x, y);
  115. X--- 116,128 ----
  116. X      /* All special cases should precede the G_NOCORPSE check */
  117. X  
  118. X      /* Note: oname() cannot be used generically for non-inventory objects
  119. X!      * unless you fix the link from the previous object in the chains.
  120. X       * (Here we know it's the first one, so there was no link.)
  121. X       */
  122. X      if (mtmp->mnamelth) {
  123. X          obj = oname(obj, NAME(mtmp), 0);
  124. X          fobj = obj;
  125. X+         level.objects[x][y] = obj;
  126. X      }
  127. X      stackobj(fobj);
  128. X      newsym(x, y);
  129. X***************
  130. X*** 376,382 ****
  131. X  
  132. X      for(otmp = fobj; otmp; otmp = otmp->nobj)
  133. X        if(throws_rocks(mtmp->data) ? otmp->otyp == BOULDER :
  134. X!             (otmp->olet == GEM_SYM && otmp->otyp < LAST_GEM+5))
  135. X          if(otmp->ox == mtmp->mx && otmp->oy == mtmp->my)
  136. X            if(mtmp->data->mlet != S_UNICORN
  137. X           || objects[otmp->otyp].g_val != 0){
  138. X--- 381,387 ----
  139. X  
  140. X      for(otmp = fobj; otmp; otmp = otmp->nobj)
  141. X        if(throws_rocks(mtmp->data) ? otmp->otyp == BOULDER :
  142. X!             (otmp->olet == GEM_SYM && otmp->otyp < LAST_GEM+6))
  143. X          if(otmp->ox == mtmp->mx && otmp->oy == mtmp->my)
  144. X            if(mtmp->data->mlet != S_UNICORN
  145. X           || objects[otmp->otyp].g_val != 0){
  146. X***************
  147. X*** 542,548 ****
  148. X              if(!(flag & ALLOW_U)) continue;
  149. X              info[cnt] |= ALLOW_U;
  150. X          } else {
  151. X!             if(levl[nx][ny].mmask) {
  152. X                  if(!(flag & ALLOW_M)) continue;
  153. X                  info[cnt] |= ALLOW_M;
  154. X                  if((m_at(nx,ny))->mtame) {
  155. X--- 547,553 ----
  156. X              if(!(flag & ALLOW_U)) continue;
  157. X              info[cnt] |= ALLOW_U;
  158. X          } else {
  159. X!             if(MON_AT(nx, ny)) {
  160. X                  if(!(flag & ALLOW_M)) continue;
  161. X                  info[cnt] |= ALLOW_M;
  162. X                  if((m_at(nx,ny))->mtame) {
  163. X***************
  164. X*** 697,706 ****
  165. X          /* Dead Kops may come back. */
  166. X          switch(rnd(5)) {
  167. X          case 1:         /* returns near the stairs */
  168. X!             (void) mkmon_at(mtmp->data->mname,xdnstair,ydnstair);
  169. X              break;
  170. X          case 2:         /* randomly */
  171. X!             (void) mkmon_at(mtmp->data->mname,0,0);
  172. X              break;
  173. X          default:
  174. X              break;
  175. X--- 702,711 ----
  176. X          /* Dead Kops may come back. */
  177. X          switch(rnd(5)) {
  178. X          case 1:         /* returns near the stairs */
  179. X!             (void) makemon(mtmp->data,xdnstair,ydnstair);
  180. X              break;
  181. X          case 2:         /* randomly */
  182. X!             (void) makemon(mtmp->data,0,0);
  183. X              break;
  184. X          default:
  185. X              break;
  186. X***************
  187. X*** 728,739 ****
  188. X  {
  189. X      relmon(mtmp);
  190. X      monfree(mtmp);
  191. X!     levl[mtmp2->mx][mtmp2->my].mmask = 1;
  192. X      mtmp2->nmon = fmon;
  193. X      fmon = mtmp2;
  194. X      if(u.ustuck == mtmp) u.ustuck = mtmp2;
  195. X      if(mtmp2->isshk) replshk(mtmp,mtmp2);
  196. X      if(mtmp2->isgd) replgd(mtmp,mtmp2);
  197. X  }
  198. X  
  199. X  void
  200. X--- 733,753 ----
  201. X  {
  202. X      relmon(mtmp);
  203. X      monfree(mtmp);
  204. X!     place_monster(mtmp2, mtmp2->mx, mtmp2->my);
  205. X      mtmp2->nmon = fmon;
  206. X      fmon = mtmp2;
  207. X      if(u.ustuck == mtmp) u.ustuck = mtmp2;
  208. X      if(mtmp2->isshk) replshk(mtmp,mtmp2);
  209. X      if(mtmp2->isgd) replgd(mtmp,mtmp2);
  210. X+ #ifdef WORM
  211. X+     if(mtmp2->wormno) {
  212. X+         /* Each square the worm is on has a pointer; fix them all */
  213. X+         register struct wseg *wtmp;
  214. X+ 
  215. X+         for(wtmp=wsegs[mtmp2->wormno]; wtmp; wtmp=wtmp->nseg)
  216. X+             place_worm_seg(mtmp2, wtmp->wx, wtmp->wy);
  217. X+     }
  218. X+ #endif
  219. X  }
  220. X  
  221. X  void
  222. X***************
  223. X*** 744,750 ****
  224. X  
  225. X      if (fmon == 0)  panic ("relmon: no fmon available.");
  226. X  
  227. X!     levl[mon->mx][mon->my].mmask = 0;
  228. X  
  229. X      if(mon == fmon) fmon = fmon->nmon;
  230. X      else {
  231. X--- 758,764 ----
  232. X  
  233. X      if (fmon == 0)  panic ("relmon: no fmon available.");
  234. X  
  235. X!     remove_monster(mon->mx, mon->my);
  236. X  
  237. X      if(mon == fmon) fmon = fmon->nmon;
  238. X      else {
  239. X***************
  240. X*** 760,766 ****
  241. X  monfree(mtmp) register struct monst *mtmp; {
  242. X      mtmp->nmon = fdmon;
  243. X      fdmon = mtmp;
  244. X!     levl[mtmp->mx][mtmp->my].mmask = 0;
  245. X  }
  246. X  
  247. X  void
  248. X--- 774,780 ----
  249. X  monfree(mtmp) register struct monst *mtmp; {
  250. X      mtmp->nmon = fdmon;
  251. X      fdmon = mtmp;
  252. X!     remove_monster(mtmp->mx, mtmp->my);
  253. X  }
  254. X  
  255. X  void
  256. X***************
  257. X*** 862,868 ****
  258. X      }
  259. X      if((mtmp->mpeaceful && !rn2(2)) || mtmp->mtame)    change_luck(-1);
  260. X      if ((mdat==&mons[PM_BLACK_UNICORN] && u.ualigntyp == U_CHAOTIC) ||
  261. X!         (mdat==&mons[PM_GREY_UNICORN] && u.ualigntyp == U_NEUTRAL) ||
  262. X          (mdat==&mons[PM_WHITE_UNICORN] && u.ualigntyp == U_LAWFUL))
  263. X          change_luck(-5);
  264. X  
  265. X--- 876,882 ----
  266. X      }
  267. X      if((mtmp->mpeaceful && !rn2(2)) || mtmp->mtame)    change_luck(-1);
  268. X      if ((mdat==&mons[PM_BLACK_UNICORN] && u.ualigntyp == U_CHAOTIC) ||
  269. X!         (mdat==&mons[PM_GRAY_UNICORN] && u.ualigntyp == U_NEUTRAL) ||
  270. X          (mdat==&mons[PM_WHITE_UNICORN] && u.ualigntyp == U_LAWFUL))
  271. X          change_luck(-5);
  272. X  
  273. X***************
  274. X*** 961,977 ****
  275. X      }
  276. X  }
  277. X  
  278. X- /*VARARGS2*/
  279. X- void
  280. X- kludge(str, arg, arg2, arg3)
  281. X-     register char *str,*arg,*arg2,*arg3;
  282. X- {
  283. X-     if(Blind || !flags.verbose) {
  284. X-         if(*str == '%') pline(str,"It",arg2,arg3);
  285. X-         else pline(str,"it",arg2,arg3);
  286. X-     } else pline(str,arg,arg2,arg3);
  287. X- }
  288. X- 
  289. X  void
  290. X  rescham() {    /* force all chameleons to become normal */
  291. X  
  292. X--- 975,980 ----
  293. X***************
  294. X*** 1094,1103 ****
  295. X  {
  296. X      coord mm;
  297. X      enexto(&mm, u.ux, u.uy, mtmp->data);
  298. X!     levl[mtmp->mx][mtmp->my].mmask = 0;
  299. X!     levl[mm.x][mm.y].mmask = 1;
  300. X!     mtmp->mx = mm.x;
  301. X!     mtmp->my = mm.y;
  302. X      pmon(mtmp);
  303. X      set_apparxy(mtmp);
  304. X  }
  305. X--- 1097,1104 ----
  306. X  {
  307. X      coord mm;
  308. X      enexto(&mm, u.ux, u.uy, mtmp->data);
  309. X!     remove_monster(mtmp->mx, mtmp->my);
  310. X!     place_monster(mtmp, mm.x, mm.y);
  311. X      pmon(mtmp);
  312. X      set_apparxy(mtmp);
  313. X  }
  314. X***************
  315. X*** 1115,1124 ****
  316. X      }
  317. X      if(x == mtmp->mx && y == mtmp->my) /* that was easy */
  318. X          return;
  319. X!     levl[mtmp->mx][mtmp->my].mmask = 0;
  320. X!     levl[x][y].mmask = 1;
  321. X!     mtmp->mx = x;
  322. X!     mtmp->my = y;
  323. X      pmon(mtmp);
  324. X      set_apparxy(mtmp);
  325. X  }
  326. X--- 1116,1123 ----
  327. X      }
  328. X      if(x == mtmp->mx && y == mtmp->my) /* that was easy */
  329. X          return;
  330. X!     remove_monster(mtmp->mx, mtmp->my);
  331. X!     place_monster(mtmp, x, y);
  332. X      pmon(mtmp);
  333. X      set_apparxy(mtmp);
  334. X  }
  335. X*** src/Old/mondata.c    Wed Sep 27 11:55:12 1989
  336. X--- src/mondata.c    Mon Sep 25 21:35:06 1989
  337. X***************
  338. X*** 278,284 ****
  339. X  
  340. X  const int grownups[][2] = { {PM_LITTLE_DOG, PM_DOG}, {PM_DOG, PM_LARGE_DOG},
  341. X      {PM_HELL_HOUND_PUP, PM_HELL_HOUND}, {PM_KITTEN, PM_HOUSECAT},
  342. X!     {PM_HOUSECAT, PM_LARGE_CAT}, {PM_BABY_GREY_DRAGON, PM_GREY_DRAGON},
  343. X      {PM_BABY_RED_DRAGON, PM_RED_DRAGON},
  344. X      {PM_BABY_WHITE_DRAGON, PM_WHITE_DRAGON},
  345. X      {PM_BABY_BLUE_DRAGON, PM_BLUE_DRAGON},
  346. X--- 278,284 ----
  347. X  
  348. X  const int grownups[][2] = { {PM_LITTLE_DOG, PM_DOG}, {PM_DOG, PM_LARGE_DOG},
  349. X      {PM_HELL_HOUND_PUP, PM_HELL_HOUND}, {PM_KITTEN, PM_HOUSECAT},
  350. X!     {PM_HOUSECAT, PM_LARGE_CAT}, {PM_BABY_GRAY_DRAGON, PM_GRAY_DRAGON},
  351. X      {PM_BABY_RED_DRAGON, PM_RED_DRAGON},
  352. X      {PM_BABY_WHITE_DRAGON, PM_WHITE_DRAGON},
  353. X      {PM_BABY_BLUE_DRAGON, PM_BLUE_DRAGON},
  354. X*** src/Old/monmove.c    Wed Sep 27 11:55:42 1989
  355. X--- src/monmove.c    Wed Sep 27 09:29:38 1989
  356. X***************
  357. X*** 59,65 ****
  358. X              here->doormask = D_BROKEN;
  359. X          }
  360. X          }
  361. X!     else pile = 12; /* it doesn't leave rocks if it didn't dig */
  362. X  
  363. X      /* Left behind a pile? */
  364. X      if(pile < 5) {
  365. X--- 59,65 ----
  366. X              here->doormask = D_BROKEN;
  367. X          }
  368. X          }
  369. X!     else return TRUE; /* it doesn't leave rocks if it didn't dig */
  370. X  
  371. X      /* Left behind a pile? */
  372. X      if(pile < 5) {
  373. X***************
  374. X*** 68,77 ****
  375. X          else
  376. X          (void) mksobj_at(ROCK, mtmp->mx, mtmp->my);
  377. X      }
  378. X!     if(canseeit) {
  379. X!         here->seen = TRUE;
  380. X          newsym(mtmp->mx,mtmp->my);
  381. X!     } else
  382. X          mnewsym(mtmp->mx,mtmp->my);
  383. X      return(TRUE);
  384. X  }
  385. X--- 68,77 ----
  386. X          else
  387. X          (void) mksobj_at(ROCK, mtmp->mx, mtmp->my);
  388. X      }
  389. X!     here->seen = TRUE; /* required for newsym and mnewsym to work */
  390. X!     if(canseeit && mtmp->minvis && !See_invisible)
  391. X          newsym(mtmp->mx,mtmp->my);
  392. X!     else
  393. X          mnewsym(mtmp->mx,mtmp->my);
  394. X      return(TRUE);
  395. X  }
  396. X***************
  397. X*** 271,276 ****
  398. X--- 271,278 ----
  399. X               if(Hallucination) pmon(mtmp);
  400. X               break;
  401. X               case 1:    /* monster moved */
  402. X+             /* Maybe it stepped on a trap and fell asleep... */
  403. X+             if(mtmp->msleep || mtmp->mfroz) return(0);
  404. X               if(!nearby && ranged_attk(mdat)) break;
  405. X               else if(mdat->mmove <= 12) return(0);
  406. X               break;
  407. X***************
  408. X*** 349,356 ****
  409. X  
  410. X      set_apparxy(mtmp);
  411. X      /* where does mtmp think you are? */
  412. X!     /* Not necessary if m_move called from here, but necessary in
  413. X!      * other calls of m_move (i.e. leprechauns dodging)
  414. X       */
  415. X      can_tunnel = tunnels(ptr) &&
  416. X  #ifdef REINCARNATION
  417. X--- 351,358 ----
  418. X  
  419. X      set_apparxy(mtmp);
  420. X      /* where does mtmp think you are? */
  421. X!     /* Not necessary if m_move called from this file, but necessary in
  422. X!      * other calls of m_move (ex. leprechauns dodging)
  423. X       */
  424. X      can_tunnel = tunnels(ptr) &&
  425. X  #ifdef REINCARNATION
  426. X***************
  427. X*** 360,367 ****
  428. X  #ifdef WORM
  429. X      if(mtmp->wormno) goto not_special;
  430. X  #endif
  431. X!     /* my dog gets a special treatment */
  432. X!     if(mtmp->mtame) return( dog_move(mtmp, after) );
  433. X  
  434. X      /* likewise for shopkeeper */
  435. X      if(mtmp->isshk) {
  436. X--- 362,372 ----
  437. X  #ifdef WORM
  438. X      if(mtmp->wormno) goto not_special;
  439. X  #endif
  440. X!     /* my dog gets special treatment */
  441. X!     if(mtmp->mtame) {
  442. X!         mmoved = dog_move(mtmp, after);
  443. X!         goto postmov;
  444. X!     }
  445. X  
  446. X      /* likewise for shopkeeper */
  447. X      if(mtmp->isshk) {
  448. X***************
  449. X*** 485,491 ****
  450. X             (likemagic && index(magical, otmp->olet)) ||
  451. X             (likerock && otmp->otyp == BOULDER) ||
  452. X             (likegems && otmp->olet == GEM_SYM &&
  453. X!             otmp->otyp < LAST_GEM + 5) ||
  454. X             (conceals && !cansee(otmp->ox,otmp->oy)) ||
  455. X             (ptr == &mons[PM_GELATINOUS_CUBE] &&
  456. X                      !index(indigestion, otmp->olet))
  457. X--- 490,496 ----
  458. X             (likemagic && index(magical, otmp->olet)) ||
  459. X             (likerock && otmp->otyp == BOULDER) ||
  460. X             (likegems && otmp->olet == GEM_SYM &&
  461. X!             otmp->otyp < LAST_GEM + 6) ||
  462. X             (conceals && !cansee(otmp->ox,otmp->oy)) ||
  463. X             (ptr == &mons[PM_GELATINOUS_CUBE] &&
  464. X                      !index(indigestion, otmp->olet))
  465. X***************
  466. X*** 527,533 ****
  467. X          nx = poss[i].x;
  468. X          ny = poss[i].y;
  469. X  
  470. X!         for(j=0; j < MTSZ && j < cnt-1; j++)
  471. X          if(nx == mtmp->mtrack[j].x && ny == mtmp->mtrack[j].y)
  472. X              if(rn2(4*(cnt-j))) goto nxti;
  473. X  
  474. X--- 532,538 ----
  475. X          nx = poss[i].x;
  476. X          ny = poss[i].y;
  477. X  
  478. X!         if (appr != 0) for(j=0; j < MTSZ && j < cnt-1; j++)
  479. X          if(nx == mtmp->mtrack[j].x && ny == mtmp->mtrack[j].y)
  480. X              if(rn2(4*(cnt-j))) goto nxti;
  481. X  
  482. X***************
  483. X*** 534,540 ****
  484. X          nearer = (dist2(nx,ny,gx,gy) < dist2(nix,niy,gx,gy));
  485. X  
  486. X          if((appr == 1 && nearer) || (appr == -1 && !nearer) ||
  487. X!                !mmoved || (!appr && !rn2(++chcnt))) {
  488. X          nix = nx;
  489. X          niy = ny;
  490. X          chi = i;
  491. X--- 539,545 ----
  492. X          nearer = (dist2(nx,ny,gx,gy) < dist2(nix,niy,gx,gy));
  493. X  
  494. X          if((appr == 1 && nearer) || (appr == -1 && !nearer) ||
  495. X!                (!appr && !rn2(++chcnt)) || !mmoved) {
  496. X          nix = nx;
  497. X          niy = ny;
  498. X          chi = i;
  499. X***************
  500. X*** 561,567 ****
  501. X          if((info[chi] & ALLOW_M) ||
  502. X             (nix == mtmp->mux && niy == mtmp->muy)) {
  503. X          mtmp2 = 
  504. X!             (levl[nix][niy].mmask ? m_at(nix,niy) : (struct monst *)0);
  505. X          if(mattackm(mtmp, mtmp2) == 1 && rn2(4) &&
  506. X              mtmp2->mlstmv != moves && mattackm(mtmp2, mtmp) == 2)
  507. X              return(2);
  508. X--- 566,572 ----
  509. X          if((info[chi] & ALLOW_M) ||
  510. X             (nix == mtmp->mux && niy == mtmp->muy)) {
  511. X          mtmp2 = 
  512. X!             (MON_AT(nix, niy) ? m_at(nix,niy) : (struct monst *)0);
  513. X          if(mattackm(mtmp, mtmp2) == 1 && rn2(4) &&
  514. X              mtmp2->mlstmv != moves && mattackm(mtmp2, mtmp) == 2)
  515. X              return(2);
  516. X***************
  517. X*** 568,580 ****
  518. X          return(3);
  519. X          }
  520. X  #ifdef WORM
  521. X!         /* The square now has a worm segment and must keep its mmask */
  522. X          if (!mtmp->wormno)
  523. X  #endif
  524. X!             levl[omx][omy].mmask = 0;
  525. X!         levl[nix][niy].mmask = 1;
  526. X!         mtmp->mx = nix;
  527. X!         mtmp->my = niy;
  528. X          for(j = MTSZ-1; j > 0; j--)
  529. X          mtmp->mtrack[j] = mtmp->mtrack[j-1];
  530. X          mtmp->mtrack[0].x = omx;
  531. X--- 573,583 ----
  532. X          return(3);
  533. X          }
  534. X  #ifdef WORM
  535. X!         /* The square now has a worm segment and must keep its MON_AT() state */
  536. X          if (!mtmp->wormno)
  537. X  #endif
  538. X!             remove_monster(omx, omy);
  539. X!         place_monster(mtmp, nix, niy);
  540. X          for(j = MTSZ-1; j > 0; j--)
  541. X          mtmp->mtrack[j] = mtmp->mtrack[j-1];
  542. X          mtmp->mtrack[0].x = omx;
  543. X***************
  544. X*** 688,695 ****
  545. X              mtmp->mdy = mtmp->my;
  546. X          }
  547. X          }
  548. X      }
  549. X-     pmon(mtmp);
  550. X      return(mmoved);
  551. X  }
  552. X  
  553. X--- 691,698 ----
  554. X              mtmp->mdy = mtmp->my;
  555. X          }
  556. X          }
  557. X+         pmon(mtmp);
  558. X      }
  559. X      return(mmoved);
  560. X  }
  561. X  
  562. X***************
  563. X*** 732,734 ****
  564. X--- 735,770 ----
  565. X             )
  566. X      );
  567. X  }
  568. X+ 
  569. X+ #ifdef STUPID_CPP    /* otherwise these functions are macros in rm.h */
  570. X+ /*
  571. X+  * Functions for encapsulation of level.monsters references.
  572. X+  */
  573. X+ void place_monster(mtmp, x, y)
  574. X+ register struct monst *mtmp;
  575. X+ int x, y;
  576. X+ {
  577. X+     level.monsters[x][y] = mtmp;
  578. X+     mtmp->mx = x;
  579. X+     mtmp->my = y;
  580. X+ }
  581. X+ 
  582. X+ void place_worm_seg(mtmp, x, y)
  583. X+ register struct monst *mtmp;
  584. X+ int x, y;
  585. X+ {
  586. X+     level.monsters[x][y] = mtmp;
  587. X+ }
  588. X+ 
  589. X+ void remove_monster(x, y)
  590. X+ int x, y;
  591. X+ {
  592. X+     level.monsters[x][y] = (struct monst *)0;
  593. X+ }
  594. X+ 
  595. X+ struct monst *m_at(x, y)
  596. X+ int x, y;
  597. X+ {
  598. X+     return(level.monsters[x][y]);
  599. X+ }
  600. X+ #endif    /* STUPID_CPP */
  601. X*** src/Old/mthrowu.c    Wed Sep 27 11:58:14 1989
  602. X--- src/mthrowu.c    Tue Sep 26 16:08:05 1989
  603. X***************
  604. X*** 23,38 ****
  605. X  };
  606. X  
  607. X  int
  608. X! thitu(tlev, dam, name)    /* u is hit by sth, but not a monster */
  609. X      register int tlev, dam;
  610. X      register char *name;
  611. X  {
  612. X      char buf[BUFSZ];
  613. X!     boolean acidic = (!strcmp(name, "splash of venom") && dam);
  614. X!     /* A horrible kludge... the problem is that we want to do something
  615. X!      * special--and we can't do it after returning since we might die and
  616. X!      * not return, but the special stuff should be done anyway...
  617. X!      */
  618. X  
  619. X      setan(name, buf);
  620. X      if(u.uac + tlev <= rnd(20)) {
  621. X--- 23,35 ----
  622. X  };
  623. X  
  624. X  int
  625. X! thitu(tlev, dam, obj, name)    /* u is hit by sth, but not a monster */
  626. X      register int tlev, dam;
  627. X+     struct obj *obj;
  628. X      register char *name;
  629. X  {
  630. X      char buf[BUFSZ];
  631. X!     boolean acidic = (obj && obj->otyp == ACID_VENOM);
  632. X  
  633. X      setan(name, buf);
  634. X      if(u.uac + tlev <= rnd(20)) {
  635. X***************
  636. X*** 43,48 ****
  637. X--- 40,52 ----
  638. X          if(Blind || !flags.verbose) You("are hit!");
  639. X          else You("are hit by %s!", buf);
  640. X  #ifdef POLYSELF
  641. X+         if (obj && obj->otyp == SILVER_ARROW && (u.ulycn != -1 ||
  642. X+                 is_demon(uasmon) || u.usym == S_VAMPIRE ||
  643. X+                 (u.usym == S_IMP && u.umonnum != PM_TENGU))) {
  644. X+             dam += rnd(20);
  645. X+             pline("You feel the %sarrow sear your flesh!",
  646. X+                 Blind ? "" : "silver ");
  647. X+         }
  648. X          if (acidic && resists_acid(uasmon))
  649. X              pline("It doesn't seem to hurt you.");
  650. X          else {
  651. X***************
  652. X*** 106,112 ****
  653. X--- 110,120 ----
  654. X  
  655. X      if(sym) {
  656. X          tmp_at(-1, sym);    /* open call */
  657. X+ #ifdef TEXTCOLOR
  658. X+         tmp_at(-3, (int)objects[obj->otyp].oc_color);
  659. X+ #else
  660. X          tmp_at(-3, (int)AT_OBJ);
  661. X+ #endif
  662. X      }
  663. X      while(range-- > 0) { /* Actually the loop is always exited by break */
  664. X          boolean vis;
  665. X***************
  666. X*** 114,120 ****
  667. X          bhitpos.x += dx;
  668. X          bhitpos.y += dy;
  669. X          vis = cansee(bhitpos.x, bhitpos.y);
  670. X!         if(levl[bhitpos.x][bhitpos.y].mmask) {
  671. X              mtmp = m_at(bhitpos.x,bhitpos.y);
  672. X  
  673. X              if(mtmp->data->ac + 8 + obj->spe <= rnd(20)) {
  674. X--- 122,128 ----
  675. X          bhitpos.x += dx;
  676. X          bhitpos.y += dy;
  677. X          vis = cansee(bhitpos.x, bhitpos.y);
  678. X!         if(MON_AT(bhitpos.x, bhitpos.y)) {
  679. X              mtmp = m_at(bhitpos.x,bhitpos.y);
  680. X  
  681. X              if(mtmp->data->ac + 8 + obj->spe <= rnd(20)) {
  682. X***************
  683. X*** 146,151 ****
  684. X--- 154,169 ----
  685. X                  }
  686. X                  }
  687. X              }
  688. X+             if (obj->otyp==SILVER_ARROW && (is_were(mtmp->data)
  689. X+                 || is_demon(mtmp->data)
  690. X+                 || mtmp->data->mlet == S_VAMPIRE
  691. X+                 || (mtmp->data->mlet==S_IMP
  692. X+                     && mtmp->data != &mons[PM_TENGU]))) {
  693. X+                 if (vis) pline("The silver arrow sears %s's flesh!",
  694. X+                 mon_nam(mtmp));
  695. X+                 else pline("Its flesh is seared!");
  696. X+                 damage += rnd(20);
  697. X+             }
  698. X              if (obj->otyp==ACID_VENOM && cansee(mtmp->mx,mtmp->my)){
  699. X                  if (resists_acid(mtmp->data)) {
  700. X                  pline("%s is unaffected.", vis ? Monnam(mtmp)
  701. X***************
  702. X*** 186,197 ****
  703. X                  int dam;
  704. X                  case CREAM_PIE:
  705. X                  case BLINDING_VENOM:
  706. X!                 hitu = thitu(8, 0, xname(singleobj));
  707. X                  break;
  708. X                  default:
  709. X                  dam = dmgval(obj, uasmon);
  710. X                  if (dam < 1) dam = 1;
  711. X!                 hitu = thitu(8+obj->spe, dam, xname(singleobj));
  712. X              }
  713. X              if (hitu && obj->opoisoned)
  714. X                  /* it's safe to call xname twice because it's the
  715. X--- 204,216 ----
  716. X                  int dam;
  717. X                  case CREAM_PIE:
  718. X                  case BLINDING_VENOM:
  719. X!                 hitu = thitu(8, 0, singleobj, xname(singleobj));
  720. X                  break;
  721. X                  default:
  722. X                  dam = dmgval(obj, uasmon);
  723. X                  if (dam < 1) dam = 1;
  724. X!                 hitu = thitu(8+obj->spe, dam, singleobj,
  725. X!                     xname(singleobj));
  726. X              }
  727. X              if (hitu && obj->opoisoned)
  728. X                  /* it's safe to call xname twice because it's the
  729. X*** src/Old/music.c    Wed Sep 27 11:58:33 1989
  730. X--- src/music.c    Mon Sep 25 22:58:27 1989
  731. X***************
  732. X*** 206,212 ****
  733. X                  /* We have to check whether monsters or player
  734. X                     fall in a chasm... */
  735. X  
  736. X!                 if (levl[x][y].mmask) {
  737. X                  mtmp = m_at(x,y);
  738. X                  if(!is_flyer(mtmp->data)) {
  739. X                      mtmp->mtrapped = 1;
  740. X--- 206,212 ----
  741. X                  /* We have to check whether monsters or player
  742. X                     fall in a chasm... */
  743. X  
  744. X!                 if (MON_AT(x, y)) {
  745. X                  mtmp = m_at(x,y);
  746. X                  if(!is_flyer(mtmp->data)) {
  747. X                      mtmp->mtrapped = 1;
  748. X***************
  749. X*** 253,259 ****
  750. X                  if (cansee(x,y))
  751. X                  pline("The door collapses.");
  752. X                  levl[x][y].doormask = D_NODOOR;
  753. X!                 if (!levl[x][y].mmask && !(x == u.ux && y == u.uy))
  754. X                  newsym(x,y);
  755. X                  break;
  756. X              }
  757. X--- 253,259 ----
  758. X                  if (cansee(x,y))
  759. X                  pline("The door collapses.");
  760. X                  levl[x][y].doormask = D_NODOOR;
  761. X!                 if (!MON_AT(x, y) && !(x == u.ux && y == u.uy))
  762. X                  newsym(x,y);
  763. X                  break;
  764. X              }
  765. X***************
  766. X*** 415,429 ****
  767. X              }
  768. X              if(tumblers)
  769. X              if(gears)
  770. X!             You("hear %d tumbler%s click and %d gear%s turn.",
  771. X!                 tumblers, (tumblers > 1 ? "s" : ""),
  772. X!                 gears, (gears > 1 ? "s" : ""));
  773. X              else
  774. X                  You("hear %d tumbler%s click.",
  775. X!                 tumblers, (tumblers > 1 ? "s" : ""));
  776. X              else if(gears)
  777. X              You("hear %d gear%s turn.",
  778. X!             gears, (gears > 1 ? "s" : ""));
  779. X          }
  780. X          }
  781. X      return 1;
  782. X--- 415,429 ----
  783. X              }
  784. X              if(tumblers)
  785. X              if(gears)
  786. X!                 You("hear %d tumbler%s click and %d gear%s turn.",
  787. X!                 tumblers, plur((long)tumblers),
  788. X!                 gears, plur((long)gears));
  789. X              else
  790. X                  You("hear %d tumbler%s click.",
  791. X!                 tumblers, plur((long)tumblers));
  792. X              else if(gears)
  793. X              You("hear %d gear%s turn.",
  794. X!                 gears, plur((long)gears));
  795. X          }
  796. X          }
  797. X      return 1;
  798. X*** src/Old/o_init.c    Wed Sep 27 12:06:05 1989
  799. X--- src/o_init.c    Fri Sep 15 00:50:41 1989
  800. X***************
  801. X*** 36,48 ****
  802. X  {
  803. X      register int j,first;
  804. X  #ifdef STRONGHOLD
  805. X!     int level = (dlevel > MAXLEVEL) ? MAXLEVEL : dlevel;
  806. X  #endif
  807. X  
  808. X      first = bases[letindex(GEM_SYM)];
  809. X  
  810. X  #ifdef STRONGHOLD
  811. X!     for(j = 0; j < 9-level/3; j++)
  812. X  #else
  813. X      for(j = 0; j < 9-dlevel/3; j++)
  814. X  #endif
  815. X--- 36,48 ----
  816. X  {
  817. X      register int j,first;
  818. X  #ifdef STRONGHOLD
  819. X!     int lev = (dlevel > MAXLEVEL) ? MAXLEVEL : dlevel;
  820. X  #endif
  821. X  
  822. X      first = bases[letindex(GEM_SYM)];
  823. X  
  824. X  #ifdef STRONGHOLD
  825. X!     for(j = 0; j < 9-lev/3; j++)
  826. X  #else
  827. X      for(j = 0; j < 9-dlevel/3; j++)
  828. X  #endif
  829. X***************
  830. X*** 54,60 ****
  831. X          Printf("Not enough gems? - first=%d j=%d LAST_GEM=%d\n",
  832. X              first, j, LAST_GEM);
  833. X      for(j = first; j < LAST_GEM; j++)
  834. X!         objects[j].oc_prob = (180+j-first)/(LAST_GEM-first);
  835. X  }
  836. X  
  837. X  /* shuffle descriptions on objects o_low to o_high */
  838. X--- 54,60 ----
  839. X          Printf("Not enough gems? - first=%d j=%d LAST_GEM=%d\n",
  840. X              first, j, LAST_GEM);
  841. X      for(j = first; j < LAST_GEM; j++)
  842. X!         objects[j].oc_prob = (184+j-first)/(LAST_GEM-first);
  843. X  }
  844. X  
  845. X  /* shuffle descriptions on objects o_low to o_high */
  846. X***************
  847. X*** 66,71 ****
  848. X--- 66,74 ----
  849. X  {
  850. X      register int i, j;
  851. X      char *desc;
  852. X+ #ifdef TEXTCOLOR
  853. X+     int color;
  854. X+ #endif /* TEXTCOLOR */
  855. X      int tmp;
  856. X  
  857. X      for(j=o_low; j <= o_high; j++) {
  858. X***************
  859. X*** 73,78 ****
  860. X--- 76,86 ----
  861. X          desc = objects[j].oc_descr;
  862. X          objects[j].oc_descr = objects[i].oc_descr;
  863. X          objects[i].oc_descr = desc;
  864. X+ #ifdef TEXTCOLOR
  865. X+         color = objects[j].oc_color;
  866. X+         objects[j].oc_color = objects[i].oc_color;
  867. X+         objects[i].oc_color = color;
  868. X+ #endif /* TEXTCOLOR */
  869. X          /* shuffle discovery list */
  870. X          tmp = disco[j];
  871. X          disco[j] = disco[i];
  872. X*** src/Old/objnam.c    Wed Sep 27 12:07:22 1989
  873. X--- src/objnam.c    Tue Sep 26 18:19:25 1989
  874. X***************
  875. X*** 203,209 ****
  876. X          case TOOL_SYM:
  877. X          if(nn)    Strcat(buf, an);
  878. X          else    Strcat(buf, dn);
  879. X!         if(obj->otyp == FIGURINE && obj->known) {
  880. X              Sprintf(eos(buf), " of a%s %s",
  881. X                  index(vowels, *mons[obj->corpsenm].mname)
  882. X                                  ? "n" : "",
  883. X--- 203,209 ----
  884. X          case TOOL_SYM:
  885. X          if(nn)    Strcat(buf, an);
  886. X          else    Strcat(buf, dn);
  887. X!         if(obj->otyp == FIGURINE) {
  888. X              Sprintf(eos(buf), " of a%s %s",
  889. X                  index(vowels, *mons[obj->corpsenm].mname)
  890. X                                  ? "n" : "",
  891. X***************
  892. X*** 503,508 ****
  893. X--- 503,510 ----
  894. X          }
  895. X          break;
  896. X      case FOOD_SYM:
  897. X+         if(OEATEN(obj))
  898. X+             Strcat(prefix, "partly eaten ");
  899. X          if(obj->otyp == CORPSE) {
  900. X              Strcat(prefix, mons[obj->corpsenm].mname);
  901. X              Strcat(prefix, " ");
  902. X***************
  903. X*** 524,532 ****
  904. X      }
  905. X  
  906. X      if((obj->owornmask & W_WEP) && !mrg_to_wielded) {
  907. X!         Strcat(bp, " (weapon in ");
  908. X!         Strcat(bp, body_part(HAND));
  909. X!         Strcat(bp, ")");
  910. X      }
  911. X      if(obj->unpaid)
  912. X          Strcat(bp, " (unpaid)");
  913. X--- 526,538 ----
  914. X      }
  915. X  
  916. X      if((obj->owornmask & W_WEP) && !mrg_to_wielded) {
  917. X!         if (obj->quan != 1)
  918. X!             Strcat(bp, " (wielded)");
  919. X!         else {
  920. X!             Strcat(bp, " (weapon in ");
  921. X!             Strcat(bp, body_part(HAND));
  922. X!             Strcat(bp, ")");
  923. X!         }
  924. X      }
  925. X      if(obj->unpaid)
  926. X          Strcat(bp, " (unpaid)");
  927. X***************
  928. X*** 541,547 ****
  929. X      return(bp);
  930. X  }
  931. X  
  932. X! /* used only in fight.c (thitu) */
  933. X  void
  934. X  setan(str,buf)
  935. X  register char *str,*buf;
  936. X--- 547,553 ----
  937. X      return(bp);
  938. X  }
  939. X  
  940. X! /* used only in mthrowu.c (thitu) */
  941. X  void
  942. X  setan(str,buf)
  943. X  register char *str,*buf;
  944. X***************
  945. X*** 562,568 ****
  946. X      }
  947. X  
  948. X      if(verb) {
  949. X!         /* verb is given in plural (i.e., without trailing s) */
  950. X          Strcat(bp, " ");
  951. X          if(otmp->quan != 1)
  952. X              Strcat(bp, verb);
  953. X--- 568,574 ----
  954. X      }
  955. X  
  956. X      if(verb) {
  957. X!         /* verb is given in plural (without trailing s) */
  958. X          Strcat(bp, " ");
  959. X          if(otmp->quan != 1)
  960. X              Strcat(bp, verb);
  961. X***************
  962. X*** 633,639 ****
  963. X      }
  964. X      Strcpy(str, oldstr);
  965. X  
  966. X!     /* Search for common compounds, i.e. lump of royal jelly */
  967. X      for(excess=(char *)0, spot=str; *spot; spot++) {
  968. X          if (!strncmp(spot, " of ", 4)
  969. X                  || !strncmp(spot, " labeled ", 9)
  970. X--- 639,645 ----
  971. X      }
  972. X      Strcpy(str, oldstr);
  973. X  
  974. X!     /* Search for common compounds, ex. lump of royal jelly */
  975. X      for(excess=(char *)0, spot=str; *spot; spot++) {
  976. X          if (!strncmp(spot, " of ", 4)
  977. X                  || !strncmp(spot, " labeled ", 9)
  978. X***************
  979. X*** 825,833 ****
  980. X      register char *p;
  981. X      register int i;
  982. X      register struct obj *otmp;
  983. X!     int cnt, spe, spesgn, typ, heavy, blessed, uncursed;
  984. X!     int iscursed, ispoisoned, mntmp, contents, iskey=0;
  985. X!     int  isnamedbox=0;
  986. X  #ifdef TUTTI_FRUTTI
  987. X      struct fruit *f;
  988. X      int ftype = current_fruit;
  989. X--- 831,839 ----
  990. X      register char *p;
  991. X      register int i;
  992. X      register struct obj *otmp;
  993. X!     int cnt, spe, spesgn, typ, heavy, blessed, uncursed, halfeaten;
  994. X!     int iscursed, ispoisoned, mntmp, contents;
  995. X!     int iskey, isnamedbox;
  996. X  #ifdef TUTTI_FRUTTI
  997. X      struct fruit *f;
  998. X      int ftype = current_fruit;
  999. X***************
  1000. X*** 845,852 ****
  1001. X      int fake=0;
  1002. X  #endif
  1003. X  
  1004. X!     cnt = spe = spesgn = typ = heavy = 
  1005. X!         blessed = uncursed = iscursed = ispoisoned = 0;
  1006. X      mntmp = -1;
  1007. X  #define UNDEFINED 0
  1008. X  #define EMPTY 1
  1009. X--- 851,858 ----
  1010. X      int fake=0;
  1011. X  #endif
  1012. X  
  1013. X!     cnt = spe = spesgn = typ = heavy = blessed = uncursed = iscursed =
  1014. X!         ispoisoned = halfeaten = iskey = isnamedbox = 0;
  1015. X      mntmp = -1;
  1016. X  #define UNDEFINED 0
  1017. X  #define EMPTY 1
  1018. X***************
  1019. X*** 875,883 ****
  1020. X              cnt = atoi(bp);
  1021. X              while(digit(*bp)) bp++;
  1022. X              while(*bp == ' ') bp++;
  1023. X!         } else if(!strncmp(bp,"blessed ",8) || !strncmp(bp,"holy ",5)) {
  1024. X              blessed=1;
  1025. X              bp += 8;
  1026. X          } else if(!strncmp(bp,"cursed ",7) || !strncmp(bp,"unholy ",7)){
  1027. X              iscursed=1;
  1028. X              bp += 7;
  1029. X--- 881,895 ----
  1030. X              cnt = atoi(bp);
  1031. X              while(digit(*bp)) bp++;
  1032. X              while(*bp == ' ') bp++;
  1033. X!         } else if(!strncmp(bp, "partly eaten ", 13)) {
  1034. X!             halfeaten = 1;
  1035. X!             bp += 13;
  1036. X!         } else if(!strncmp(bp,"blessed ",8)) {
  1037. X              blessed=1;
  1038. X              bp += 8;
  1039. X+         } else if(!strncmp(bp,"holy ",5)) {
  1040. X+             blessed=1;
  1041. X+             bp += 5;
  1042. X          } else if(!strncmp(bp,"cursed ",7) || !strncmp(bp,"unholy ",7)){
  1043. X              iscursed=1;
  1044. X              bp += 7;
  1045. X***************
  1046. X*** 996,1001 ****
  1047. X--- 1008,1014 ----
  1048. X      }
  1049. X      /* Find corpse type w/o "of" (red dragon scale mail, yeti corpse) */
  1050. X      if (strncmp(bp, "samurai sword", 13)) /* not the "samurai" monster! */
  1051. X+     if (strncmp(bp, "wizard lock", 11)) /* not the "wizard" monster! */
  1052. X      if (strncmp(bp, "orcish", 6)) /* not the "orc" monster! */
  1053. X      if (mntmp < 0) if ((mntmp = name_to_mon(bp)) >= 0) {
  1054. X          bp += strlen(mons[mntmp].mname);
  1055. X***************
  1056. X*** 1161,1167 ****
  1057. X  #endif
  1058. X                          ) cnt=5000;
  1059. X          if (cnt < 1) cnt=1;
  1060. X!         pline("%d gold piece%s.", cnt, cnt==1 ? "" : "s");
  1061. X          u.ugold += cnt;
  1062. X          flags.botl=1;
  1063. X          return (&zeroobj);
  1064. X--- 1174,1180 ----
  1065. X  #endif
  1066. X                          ) cnt=5000;
  1067. X          if (cnt < 1) cnt=1;
  1068. X!         pline("%d gold piece%s.", cnt, plur((long)cnt));
  1069. X          u.ugold += cnt;
  1070. X          flags.botl=1;
  1071. X          return (&zeroobj);
  1072. X***************
  1073. X*** 1213,1219 ****
  1074. X      /* helmet is not generic */
  1075. X  
  1076. X      an = bp;
  1077. X!     if (!dn) dn = an; /* i.e., "black cap" */
  1078. X  srch:
  1079. X      i = 1;
  1080. X      if(let) i = bases[letindex(let)];
  1081. X--- 1226,1232 ----
  1082. X      /* helmet is not generic */
  1083. X  
  1084. X      an = bp;
  1085. X!     if (!dn) dn = an; /* ex. "black cap" */
  1086. X  srch:
  1087. X      i = 1;
  1088. X      if(let) i = bases[letindex(let)];
  1089. X***************
  1090. X*** 1262,1274 ****
  1091. X       * wizards to wish for it since it's faster than polymorphing and
  1092. X       * spitting.
  1093. X       */
  1094. X!     if(otmp->olet==VENOM_SYM
  1095. X  #ifdef WIZARD
  1096. X!                 && !wizard
  1097. X  #endif
  1098. X-                         ) {
  1099. X-         free((genericptr_t) otmp);
  1100. X-         return((struct obj *)0);
  1101. X      }
  1102. X      if(iskey) otmp->spe = (iskey-1);
  1103. X      if(isnamedbox && (otmp->otyp==LARGE_BOX || otmp->otyp==CHEST))
  1104. X--- 1275,1289 ----
  1105. X       * wizards to wish for it since it's faster than polymorphing and
  1106. X       * spitting.
  1107. X       */
  1108. X!     if(otmp->olet==VENOM_SYM) {
  1109. X! #ifdef WIZARD
  1110. X!         if (!wizard) {
  1111. X! #endif
  1112. X!             free((genericptr_t) otmp);
  1113. X!             return((struct obj *)0);
  1114. X  #ifdef WIZARD
  1115. X!         } else otmp->spe = 1;
  1116. X  #endif
  1117. X      }
  1118. X      if(iskey) otmp->spe = (iskey-1);
  1119. X      if(isnamedbox && (otmp->otyp==LARGE_BOX || otmp->otyp==CHEST))
  1120. X***************
  1121. X*** 1303,1309 ****
  1122. X          if (spe > otmp->spe) spe = otmp->spe;
  1123. X      }
  1124. X  
  1125. X!     if (spesgn == -1 && spe > 0) spe = -spe;
  1126. X  
  1127. X      /* set otmp->spe.  This may, or may not, use spe... */
  1128. X      switch (typ) {
  1129. X--- 1318,1324 ----
  1130. X          if (spe > otmp->spe) spe = otmp->spe;
  1131. X      }
  1132. X  
  1133. X!     if (spesgn == -1) spe = -spe;
  1134. X  
  1135. X      /* set otmp->spe.  This may, or may not, use spe... */
  1136. X      switch (typ) {
  1137. X***************
  1138. X*** 1379,1385 ****
  1139. X          case DRAGON_SCALE_MAIL: /* Not actually possible unless they
  1140. X                     typed "red dragon dragon scale mail" */
  1141. X          case SCALE_MAIL:
  1142. X!             if (mntmp >= PM_GREY_DRAGON &&
  1143. X                  mntmp <= PM_YELLOW_DRAGON)
  1144. X                  otmp->corpsenm = mntmp;
  1145. X              if (otmp->corpsenm >= 0)
  1146. X--- 1394,1400 ----
  1147. X          case DRAGON_SCALE_MAIL: /* Not actually possible unless they
  1148. X                     typed "red dragon dragon scale mail" */
  1149. X          case SCALE_MAIL:
  1150. X!             if (mntmp >= PM_GRAY_DRAGON &&
  1151. X                  mntmp <= PM_YELLOW_DRAGON)
  1152. X                  otmp->corpsenm = mntmp;
  1153. X              if (otmp->corpsenm >= 0)
  1154. X***************
  1155. X*** 1420,1447 ****
  1156. X      if (name) otmp = oname(otmp, name, 0);
  1157. X      otmp->owt = weight(otmp);
  1158. X      if (heavy) otmp->owt += 15;
  1159. X      return(otmp);
  1160. X- }
  1161. X- 
  1162. X- boolean
  1163. X- uses_known(otmp)
  1164. X- register struct obj *otmp;
  1165. X- /* returns TRUE if otmp->known would be used to affect the full description
  1166. X-  * of the item
  1167. X-  * if not, otmp->dknown and otmp->bknown give all the information of otmp->known
  1168. X-  * and otmp->known should always be set to avoid problems with items not
  1169. X-  * merging due to different values of otmp->known
  1170. X-  */
  1171. X- {
  1172. X-     return (otmp->olet == ARMOR_SYM ||
  1173. X-         otmp->olet == WAND_SYM ||
  1174. X-         otmp->olet == WEAPON_SYM ||
  1175. X-         ((otmp->olet == TOOL_SYM || otmp->olet == RING_SYM) &&
  1176. X-             objects[otmp->otyp].oc_charged) ||
  1177. X-         otmp->otyp == FIGURINE ||
  1178. X-         otmp->otyp == EGG ||
  1179. X-         otmp->otyp == TIN ||
  1180. X-         otmp->otyp == AMULET_OF_YENDOR);
  1181. X  }
  1182. X  
  1183. X  static int
  1184. X--- 1435,1442 ----
  1185. X      if (name) otmp = oname(otmp, name, 0);
  1186. X      otmp->owt = weight(otmp);
  1187. X      if (heavy) otmp->owt += 15;
  1188. X+     if (halfeaten && otmp->olet == FOOD_SYM) OEATEN(otmp) = 1;
  1189. X      return(otmp);
  1190. X  }
  1191. X  
  1192. X  static int
  1193. X*** src/Old/options.c    Wed Sep 27 12:08:11 1989
  1194. X--- src/options.c    Mon Sep 25 23:23:08 1989
  1195. X***************
  1196. X*** 5,11 ****
  1197. X  #include "hack.h"
  1198. X  static boolean set_order;
  1199. X  
  1200. X! static void nmcpy();
  1201. X  
  1202. X  void
  1203. X  initoptions()
  1204. X--- 5,12 ----
  1205. X  #include "hack.h"
  1206. X  static boolean set_order;
  1207. X  
  1208. X! static void nmcpy P((char *, char *, int));
  1209. X! static int next_opt P((char *));
  1210. X  
  1211. X  void
  1212. X  initoptions()
  1213. X***************
  1214. X*** 28,33 ****
  1215. X--- 29,37 ----
  1216. X      nmcpy(pl_fruit, objects[SLIME_MOLD].oc_name, PL_FSIZ);
  1217. X  #endif
  1218. X      flags.num_pad = FALSE;
  1219. X+ #ifdef TEXTCOLOR
  1220. X+     flags.use_color = TRUE;
  1221. X+ #endif
  1222. X  #ifdef MSDOS
  1223. X  #ifdef DECRAINBOW
  1224. X      flags.DECRainbow = FALSE;
  1225. X***************
  1226. X*** 260,265 ****
  1227. X--- 264,276 ----
  1228. X          return;
  1229. X      }
  1230. X  
  1231. X+ #ifdef TEXTCOLOR
  1232. X+     if (!strncmp(opts, "col", 3)) {
  1233. X+         flags.use_color = !negated;
  1234. X+         return;
  1235. X+     }
  1236. X+ #endif
  1237. X+ 
  1238. X  #ifdef DGK
  1239. X      if (!strncmp(opts, "IBM", 3)) {
  1240. X          flags.IBMBIOS = !negated;
  1241. X***************
  1242. X*** 546,551 ****
  1243. X--- 557,565 ----
  1244. X          Strcat(buf, inv_order);
  1245. X          Strcat(buf, ",");
  1246. X          }
  1247. X+ #ifdef TEXTCOLOR
  1248. X+         if (flags.use_color) Strcat(buf, "color,");
  1249. X+ #endif
  1250. X          if (flags.confirm) Strcat(buf,"confirm,");
  1251. X          if (flags.safe_dog) Strcat(buf,"safe_pet,");
  1252. X          if (flags.pickup) Strcat(buf,"pickup,");
  1253. X***************
  1254. X*** 580,585 ****
  1255. X--- 594,600 ----
  1256. X  }
  1257. X  
  1258. X  #define Page_line(x)    if(page_line(x)) goto quit
  1259. X+ #define Next_opt(x)    if (next_opt(x)) goto quit
  1260. X  
  1261. X  void
  1262. X  option_help() {
  1263. X***************
  1264. X*** 601,624 ****
  1265. X      Page_line("");
  1266. X  
  1267. X      Page_line("Boolean options (which can be negated by prefixing them with '!' or \"no\"):");
  1268. X-     Page_line("confirm, (fe)male, fixinv, pickup, rest_on_space, safe_pet, silent, sortpack,");
  1269. X  #ifdef MSDOS
  1270. X! #ifdef NEWS
  1271. X!     Page_line("time, tombstone, verbose, news, number_pad, rawio, and IBM_BIOS");
  1272. X! #else
  1273. X!     Page_line("time, tombstone, verbose, number_pad, rawio, and IBM_BIOS");
  1274. X  #endif
  1275. X! #ifdef DECRAINBOW
  1276. X!     Page_line("and DEC_Rainbow.");
  1277. X! #endif /* DECRAINBOW */
  1278. X! #else /* MSDOS */
  1279. X  #ifdef NEWS
  1280. X!     Page_line("time, tombstone, verbose, news, null, ignintr, and standout.");
  1281. X! #else
  1282. X!     Page_line("time, tombstone, verbose, null, ignintr, and standout.");
  1283. X  #endif
  1284. X! #endif /* MSDOS */
  1285. X!     Page_line("");
  1286. X  
  1287. X      Page_line("Compound options:");
  1288. X      Page_line("`name'      - your character's name (e.g., name:Merlin-W),");
  1289. X--- 616,654 ----
  1290. X      Page_line("");
  1291. X  
  1292. X      Page_line("Boolean options (which can be negated by prefixing them with '!' or \"no\"):");
  1293. X  #ifdef MSDOS
  1294. X! # ifdef DECRAINBOW
  1295. X!     Next_opt("DEC_Rainbow, ");
  1296. X! # endif
  1297. X!     Next_opt("IBM_BIOS, ");
  1298. X  #endif
  1299. X! #ifdef TEXTCOLOR
  1300. X!     Next_opt("color, ");
  1301. X! #endif
  1302. X!     Next_opt("confirm, ");
  1303. X!     Next_opt("(fe)male, "); Next_opt("fixinv, ");
  1304. X! #ifdef UNIX
  1305. X!     Next_opt("ignintr, ");
  1306. X! #endif
  1307. X  #ifdef NEWS
  1308. X!     Next_opt("news, ");
  1309. X  #endif
  1310. X! #ifdef UNIX
  1311. X!     Next_opt("null, ");
  1312. X! #endif
  1313. X!     Next_opt("number_pad, ");
  1314. X!     Next_opt("pickup, ");
  1315. X! #ifdef MSDOS
  1316. X!     Next_opt("rawio, ");
  1317. X! #endif
  1318. X!     Next_opt("rest_on_space, "); Next_opt("safe_pet, ");
  1319. X!     Next_opt("silent, "); Next_opt("sortpack, ");
  1320. X! #ifdef UNIX
  1321. X!     Next_opt("standout, ");
  1322. X! #endif
  1323. X!     Next_opt("time, "); Next_opt("tombstone, ");
  1324. X!     Next_opt("and verbose.");
  1325. X!     Next_opt("");
  1326. X  
  1327. X      Page_line("Compound options:");
  1328. X      Page_line("`name'      - your character's name (e.g., name:Merlin-W),");
  1329. X***************
  1330. X*** 642,647 ****
  1331. X--- 672,702 ----
  1332. X  quit:
  1333. X      set_pager(2);
  1334. X      return;
  1335. X+ }
  1336. X+ 
  1337. X+ /*
  1338. X+  * prints the next boolean option, on the same line if possible, on a new
  1339. X+  * line if not
  1340. X+  */
  1341. X+ static int
  1342. X+ next_opt(str)
  1343. X+     char *str;
  1344. X+ {
  1345. X+     static char buf[80];
  1346. X+     static int i = 0;
  1347. X+     int r = 0;
  1348. X+ 
  1349. X+     i += strlen(str);
  1350. X+     if (i > (CO - 2) || !*str) {
  1351. X+         r = page_line(buf);
  1352. X+         buf[0] = 0;
  1353. X+         i = strlen(str);
  1354. X+     }
  1355. X+     if (*str)
  1356. X+         strcat(buf, str);
  1357. X+     else
  1358. X+         (void) page_line(str);    /* always returns 0 on "" */
  1359. X+     return r;
  1360. X  }
  1361. X  
  1362. X  #ifdef TUTTI_FRUTTI
  1363. X*** src/Old/pager.c    Wed Sep 27 12:08:41 1989
  1364. X--- src/pager.c    Wed Sep 27 09:29:44 1989
  1365. X***************
  1366. X*** 29,35 ****
  1367. X      FILE *fp;
  1368. X      char bufr[BUFSZ+6];
  1369. X      register char *buf = &bufr[6], *ep, q;
  1370. X-     register struct monst *mtmp;
  1371. X  #ifdef OS2_CODEVIEW
  1372. X      char tmp[PATHLEN];
  1373. X  
  1374. X--- 29,34 ----
  1375. X***************
  1376. X*** 44,50 ****
  1377. X      else {
  1378. X          coord    cc;
  1379. X          uchar    r;
  1380. X-         boolean bycurs = FALSE;
  1381. X  
  1382. X          pline ("Specify unknown object by cursor? ");
  1383. X          q = ynq();
  1384. X--- 43,48 ----
  1385. X***************
  1386. X*** 56,62 ****
  1387. X              pline("Specify what? ");
  1388. X              r = readchar();
  1389. X          } else {
  1390. X-             bycurs = TRUE;
  1391. X              cc.x = u.ux;
  1392. X              cc.y = u.uy;
  1393. X      selobj:
  1394. X--- 54,59 ----
  1395. X***************
  1396. X*** 68,73 ****
  1397. X--- 65,71 ----
  1398. X                  return 0;
  1399. X              }
  1400. X              r = levl[cc.x][cc.y].scrsym;
  1401. X+             if (!r || !levl[cc.x][cc.y].seen) r = ' ';
  1402. X          }
  1403. X  
  1404. X  #define conv_sym(x)    if(r == showsyms.x) q = defsyms.x
  1405. X***************
  1406. X*** 109,131 ****
  1407. X          else conv_sym(dbvwall);
  1408. X          else conv_sym(dbhwall);
  1409. X  #endif
  1410. X-         else q = r;
  1411. X  #undef conv_sym
  1412. X! 
  1413. X!         if (index(quitchars, q)) {
  1414. X!             (void) fclose(fp); /* sweet@scubed */
  1415. X!             return 0;
  1416. X!         }
  1417. X!         if(q == '%') {
  1418. X!             pline("%%       a piece of food");
  1419. X!             if(bycurs) {
  1420. X!                 buf = &bufr[6];
  1421. X!                 more();
  1422. X!                 rewind(fp);
  1423. X!                 goto selobj;
  1424. X              }
  1425. X-             (void) fclose(fp);
  1426. X-             return 0;
  1427. X          }
  1428. X  
  1429. X          if(q != '\t')
  1430. X--- 107,119 ----
  1431. X          else conv_sym(dbvwall);
  1432. X          else conv_sym(dbhwall);
  1433. X  #endif
  1434. X  #undef conv_sym
  1435. X!         else {
  1436. X!             q = r;
  1437. X!             if (index(quitchars, q)) {
  1438. X!                 (void) fclose(fp); /* sweet@scubed */
  1439. X!                 return 0;
  1440. X              }
  1441. X          }
  1442. X  
  1443. X          if(q != '\t')
  1444. X***************
  1445. X*** 140,152 ****
  1446. X                  buf[0] = r;
  1447. X                  (void) strncpy(buf+1, "       ", 7);
  1448. X              }
  1449. X!             pline(buf);
  1450. X              if(cc.x != -1) {
  1451. X  #ifdef ALTARS
  1452. X                  if (r == showsyms.altar && q == defsyms.altar &&
  1453. X                  (IS_ALTAR(levl[cc.x][cc.y].typ) ||
  1454. X!                  (levl[cc.x][cc.y].mmask &&
  1455. X!                     m_at(cc.x,cc.y)->mimic))
  1456. X                     ) {
  1457. X                      int type = levl[cc.x][cc.y].altarmask &
  1458. X                          ~A_SHRINE;
  1459. X--- 128,146 ----
  1460. X                  buf[0] = r;
  1461. X                  (void) strncpy(buf+1, "       ", 7);
  1462. X              }
  1463. X!             /* use %s so '%' won't be interpreted as a format */
  1464. X!             pline("%s", buf);
  1465. X              if(cc.x != -1) {
  1466. X+                 register struct monst *mtmp;
  1467. X+ 
  1468. X+                 if(MON_AT(cc.x,cc.y))
  1469. X+                 mtmp = m_at(cc.x,cc.y);
  1470. X+                 else
  1471. X+                 mtmp = (struct monst *) 0;
  1472. X  #ifdef ALTARS
  1473. X                  if (r == showsyms.altar && q == defsyms.altar &&
  1474. X                  (IS_ALTAR(levl[cc.x][cc.y].typ) ||
  1475. X!                  (mtmp && mtmp->mimic))
  1476. X                     ) {
  1477. X                      int type = levl[cc.x][cc.y].altarmask &
  1478. X                          ~A_SHRINE;
  1479. X***************
  1480. X*** 154,167 ****
  1481. X                        (type == A_NEUTRAL) ? "(neutral)" :
  1482. X                        "(lawful)");
  1483. X                  } else
  1484. X                  if (q == CHAIN_SYM && OBJ_AT(cc.x, cc.y))
  1485. X                      pline("(chain)");
  1486. X!                 else
  1487. X! #endif
  1488. X!                 if (r == showsyms.door && q == defsyms.door &&
  1489. X                  (IS_DOOR(levl[cc.x][cc.y].typ) ||
  1490. X!                                  (levl[cc.x][cc.y].mmask &&
  1491. X!                     m_at(cc.x,cc.y)->mimic))) {
  1492. X                  /* Note: this will say mimics in walls are
  1493. X                   *     closed doors, which we want.
  1494. X                   */
  1495. X--- 148,159 ----
  1496. X                        (type == A_NEUTRAL) ? "(neutral)" :
  1497. X                        "(lawful)");
  1498. X                  } else
  1499. X+ #endif
  1500. X                  if (q == CHAIN_SYM && OBJ_AT(cc.x, cc.y))
  1501. X                      pline("(chain)");
  1502. X!                 else if (r == showsyms.door && q == defsyms.door &&
  1503. X                  (IS_DOOR(levl[cc.x][cc.y].typ) ||
  1504. X!                  (mtmp && mtmp->mimic))) {
  1505. X                  /* Note: this will say mimics in walls are
  1506. X                   *     closed doors, which we want.
  1507. X                   */
  1508. X***************
  1509. X*** 191,215 ****
  1510. X                  IS_SINK(levl[cc.x][cc.y].typ))
  1511. X                      pline("(sink)");
  1512. X  #endif
  1513. X!             }
  1514. X!             if (!Invisible 
  1515. X  #ifdef POLYSELF
  1516. X                  && !u.uundetected
  1517. X  #endif
  1518. X                      && u.ux==cc.x && u.uy==cc.y) {
  1519. X!                 pline("(%s named %s)",
  1520. X  #ifdef POLYSELF
  1521. X!                 u.mtimedone ? mons[u.umonnum].mname :
  1522. X  #endif
  1523. X!                 pl_character, plname);
  1524. X!             } else if(levl[cc.x][cc.y].mmask) {
  1525. X!                 mtmp = m_at(cc.x,cc.y);
  1526. X!                 if (q == mtmp->data->mlet)
  1527. X!                 pline("(%s%s)",
  1528. X!                     mtmp->mtame ? "tame " :
  1529. X!                       mtmp->mpeaceful ? "peaceful " : "",
  1530. X!                     strncmp(lmonnam(mtmp), "the ", 4)
  1531. X!                       ? lmonnam(mtmp) : lmonnam(mtmp)+4);
  1532. X              }
  1533. X              if(ep[-1] == ';') {
  1534. X                  pline("More info? ");
  1535. X--- 183,211 ----
  1536. X                  IS_SINK(levl[cc.x][cc.y].typ))
  1537. X                      pline("(sink)");
  1538. X  #endif
  1539. X!                 if (!Invisible 
  1540. X  #ifdef POLYSELF
  1541. X                  && !u.uundetected
  1542. X  #endif
  1543. X                      && u.ux==cc.x && u.uy==cc.y) {
  1544. X!                 pline("(%s named %s)",
  1545. X  #ifdef POLYSELF
  1546. X!                     u.mtimedone ? mons[u.umonnum].mname :
  1547. X  #endif
  1548. X!                     pl_character, plname);
  1549. X!                 /* Note: the blind/telepathy check is necessary.
  1550. X!                  * Otherwise a ghost sitting on a blank square
  1551. X!                  * gets identified even while blind because the
  1552. X!                  * symbol is "correct".
  1553. X!                  */
  1554. X!                 } else if (mtmp && (!Blind || Telepat)) {
  1555. X!                 if (q == mtmp->data->mlet)
  1556. X!                     pline("(%s%s)",
  1557. X!                     mtmp->mtame ? "tame " :
  1558. X!                       mtmp->mpeaceful ? "peaceful " : "",
  1559. X!                     strncmp(lmonnam(mtmp), "the ", 4)
  1560. X!                       ? lmonnam(mtmp) : lmonnam(mtmp)+4);
  1561. X!                 }
  1562. X              }
  1563. X              if(ep[-1] == ';') {
  1564. X                  pline("More info? ");
  1565. X***************
  1566. X*** 218,224 ****
  1567. X                      return 0;
  1568. X                  }
  1569. X              }
  1570. X!             if(bycurs) {
  1571. X                  buf = &bufr[6];
  1572. X                  more();
  1573. X                  rewind(fp);
  1574. X--- 214,220 ----
  1575. X                      return 0;
  1576. X                  }
  1577. X              }
  1578. X!             if(cc.x != -1) {
  1579. X                  buf = &bufr[6];
  1580. X                  more();
  1581. X                  rewind(fp);
  1582. X***************
  1583. X*** 254,264 ****
  1584. X      }
  1585. X  
  1586. X      pline("What command? ");
  1587. X! #ifdef UNIX
  1588. X      introff();
  1589. X  #endif
  1590. X      q = readchar();
  1591. X! #ifdef UNIX
  1592. X      intron();
  1593. X  #endif
  1594. X      ctrl = ((q <= '\033') ? (q - 1 + 'A') : 0);
  1595. X--- 250,260 ----
  1596. X      }
  1597. X  
  1598. X      pline("What command? ");
  1599. X! #if defined(UNIX) || defined(VMS)
  1600. X      introff();
  1601. X  #endif
  1602. X      q = readchar();
  1603. X! #if defined(UNIX) || defined(VMS)
  1604. X      intron();
  1605. X  #endif
  1606. X      ctrl = ((q <= '\033') ? (q - 1 + 'A') : 0);
  1607. X***************
  1608. X*** 282,288 ****
  1609. X              buf[0] = q;
  1610. X              (void) strncpy(buf+1, "       ", 7);
  1611. X          }
  1612. X!         pline(buf);
  1613. X          (void) fclose(fp);
  1614. X          return 0;
  1615. X          }
  1616. X--- 278,284 ----
  1617. X              buf[0] = q;
  1618. X              (void) strncpy(buf+1, "       ", 7);
  1619. X          }
  1620. X!         pline("%s", buf);
  1621. X          (void) fclose(fp);
  1622. X          return 0;
  1623. X          }
  1624. X***************
  1625. X*** 514,520 ****
  1626. X  
  1627. X      /* --- now we really do it --- */
  1628. X      if(mode == 2 && linect == 1)                /* topline only */
  1629. X!         pline(texthead->line_text);
  1630. X      else
  1631. X      if(mode == 2) {
  1632. X          register int curline, lth;
  1633. X--- 510,516 ----
  1634. X  
  1635. X      /* --- now we really do it --- */
  1636. X      if(mode == 2 && linect == 1)                /* topline only */
  1637. X!         pline("%s", texthead->line_text);
  1638. X      else
  1639. X      if(mode == 2) {
  1640. X          register int curline, lth;
  1641. X***************
  1642. X*** 760,765 ****
  1643. X--- 756,762 ----
  1644. X  }
  1645. X  #endif /* SHELL /**/
  1646. X  
  1647. X+ #if defined(SHELL) || defined(DEF_PAGER) || defined(DEF_MAILREADER)
  1648. X  int
  1649. X  child(wt)
  1650. X  int wt;
  1651. X***************
  1652. X*** 806,809 ****
  1653. X--- 803,807 ----
  1654. X      docrt();
  1655. X      return(0);
  1656. X  }
  1657. X+ #endif
  1658. X  #endif /* UNIX /**/
  1659. X*** src/Old/panic.c    Wed Sep 27 12:09:11 1989
  1660. X--- src/panic.c    Sun Sep 17 14:26:41 1989
  1661. X***************
  1662. X*** 6,11 ****
  1663. X--- 6,12 ----
  1664. X   */
  1665. X  /* NetHack may be freely redistributed.  See license for details. */
  1666. X  
  1667. X+ #define NEED_VARARGS
  1668. X  #include    "config.h"
  1669. X  
  1670. X  #ifdef MSDOS
  1671. X***************
  1672. X*** 17,25 ****
  1673. X  boolean panicking;
  1674. X  
  1675. X  void
  1676. X! panic(str,a1,a2,a3,a4,a5,a6)
  1677. X! char *str;
  1678. X! {
  1679. X      if(panicking++)
  1680. X  #ifdef SYSV
  1681. X          (void)
  1682. X--- 18,26 ----
  1683. X  boolean panicking;
  1684. X  
  1685. X  void
  1686. X! panic VA_DECL(char *,str)
  1687. X!     VA_START(str);
  1688. X!     VA_INIT(str, char *);
  1689. X      if(panicking++)
  1690. X  #ifdef SYSV
  1691. X          (void)
  1692. X***************
  1693. X*** 27,40 ****
  1694. X          abort();    /* avoid loops - this should never happen*/
  1695. X  
  1696. X      (void) fputs(" ERROR:  ", stderr);
  1697. X!     Printf(str,a1,a2,a3,a4,a5,a6);
  1698. X      (void) fflush(stderr);
  1699. X! #ifdef UNIX
  1700. X  # ifdef SYSV
  1701. X          (void)
  1702. X  # endif
  1703. X              abort();    /* generate core dump */
  1704. X  #endif
  1705. X      exit(1);        /* redundant */
  1706. X      return;
  1707. X  }
  1708. X--- 28,42 ----
  1709. X          abort();    /* avoid loops - this should never happen*/
  1710. X  
  1711. X      (void) fputs(" ERROR:  ", stderr);
  1712. X!     Vprintf(str,VA_ARGS);
  1713. X      (void) fflush(stderr);
  1714. X! #if defined(UNIX) || defined(VMS)
  1715. X  # ifdef SYSV
  1716. X          (void)
  1717. X  # endif
  1718. X              abort();    /* generate core dump */
  1719. X  #endif
  1720. X+     VA_END();
  1721. X      exit(1);        /* redundant */
  1722. X      return;
  1723. X  }
  1724. X*** src/Old/pickup.c    Wed Sep 27 12:09:25 1989
  1725. X--- src/pickup.c    Tue Sep 26 12:59:19 1989
  1726. X***************
  1727. X*** 29,37 ****
  1728. X      dummygold.oy = u.uy;
  1729. X      dummygold.olet = GOLD_SYM;
  1730. X      dummygold.nobj = fobj;
  1731. X      dummygold.cobj = 0;
  1732. X  
  1733. X!     if(Levitation) return;
  1734. X      if (all && !flags.pickup) {
  1735. X          int ct = 0;
  1736. X  
  1737. X--- 29,41 ----
  1738. X      dummygold.oy = u.uy;
  1739. X      dummygold.olet = GOLD_SYM;
  1740. X      dummygold.nobj = fobj;
  1741. X+     dummygold.nexthere = level.objects[u.ux][u.uy];
  1742. X      dummygold.cobj = 0;
  1743. X  
  1744. X!     if(Levitation) {
  1745. X!         if (all && !flags.pickup) read_engr_at(u.ux,u.uy);
  1746. X!         return;
  1747. X!     }
  1748. X      if (all && !flags.pickup) {
  1749. X          int ct = 0;
  1750. X  
  1751. X***************
  1752. X*** 65,72 ****
  1753. X          register int ct = 0;
  1754. X  
  1755. X          if (gold) ct++;
  1756. X!         for(obj = fobj; obj; obj = obj->nobj)
  1757. X!             if(obj->ox == u.ux && obj->oy == u.uy)
  1758. X              if(!obj->cobj) ct++;
  1759. X          if(ct < 2)
  1760. X              all++;
  1761. X--- 69,75 ----
  1762. X          register int ct = 0;
  1763. X  
  1764. X          if (gold) ct++;
  1765. X!         for(obj = level.objects[u.ux][u.uy]; obj; obj = obj->nexthere)
  1766. X              if(!obj->cobj) ct++;
  1767. X          if(ct < 2)
  1768. X              all++;
  1769. X***************
  1770. X*** 76,82 ****
  1771. X  
  1772. X      /* added by GAN 10/24/86 to allow selective picking up */
  1773. X      if(!all)  {
  1774. X!         register struct obj *otmp = fobj;
  1775. X  
  1776. X          ilets[iletct] = 0;
  1777. X          if(gold) {
  1778. X--- 79,85 ----
  1779. X  
  1780. X      /* added by GAN 10/24/86 to allow selective picking up */
  1781. X      if(!all)  {
  1782. X!         register struct obj *otmp = level.objects[u.ux][u.uy];
  1783. X  
  1784. X          ilets[iletct] = 0;
  1785. X          if(gold) {
  1786. X***************
  1787. X*** 84,95 ****
  1788. X              ilets[iletct] = 0;
  1789. X          }
  1790. X          while(otmp) {
  1791. X!             if(!index(ilets, otmp->olet) && !otmp->cobj &&
  1792. X!                otmp->ox == u.ux && otmp->oy == u.uy)  {
  1793. X                  ilets[iletct++] = otmp->olet;
  1794. X                  ilets[iletct] = 0;
  1795. X              }
  1796. X!             otmp = otmp->nobj;
  1797. X          }
  1798. X          if(iletct == 1)
  1799. X              Strcpy(buf,ilets);
  1800. X--- 87,97 ----
  1801. X              ilets[iletct] = 0;
  1802. X          }
  1803. X          while(otmp) {
  1804. X!             if(!index(ilets, otmp->olet) && !otmp->cobj) {
  1805. X                  ilets[iletct++] = otmp->olet;
  1806. X                  ilets[iletct] = 0;
  1807. X              }
  1808. X!             otmp = otmp->nexthere;
  1809. X          }
  1810. X          if(iletct == 1)
  1811. X              Strcpy(buf,ilets);
  1812. X***************
  1813. X*** 127,135 ****
  1814. X      }
  1815. X      if(all_of_a_type && !olets[0]) all = TRUE;
  1816. X  
  1817. X!     for(obj = (gold ? &dummygold : fobj); obj; obj = obj2) {
  1818. X!         obj2 = obj->nobj;   /* perhaps obj will be picked up */
  1819. X!         if(!obj->cobj && obj->ox == u.ux && obj->oy == u.uy) {
  1820. X          if(flags.run) nomul(0);
  1821. X  
  1822. X          if(!all)  {
  1823. X--- 129,138 ----
  1824. X      }
  1825. X      if(all_of_a_type && !olets[0]) all = TRUE;
  1826. X  
  1827. X!     for(obj = (gold ? &dummygold : level.objects[u.ux][u.uy]); obj;
  1828. X!             obj = obj2) {
  1829. X!         obj2 = obj->nexthere;   /* perhaps obj will be picked up */
  1830. X!         if(!obj->cobj) {
  1831. X          if(flags.run) nomul(0);
  1832. X  
  1833. X          if(!all)  {
  1834. X***************
  1835. X*** 282,288 ****
  1836. X            obj->quan = pickquan; /* to fool prinv() */
  1837. X            if(uwep && uwep == obj) mrg_to_wielded = TRUE;
  1838. X            prinv(obj);
  1839. X!           if(mrg_to_wielded) mrg_to_wielded = FALSE;
  1840. X            obj->quan = mergquan;
  1841. X          }
  1842. X          }
  1843. X--- 285,291 ----
  1844. X            obj->quan = pickquan; /* to fool prinv() */
  1845. X            if(uwep && uwep == obj) mrg_to_wielded = TRUE;
  1846. X            prinv(obj);
  1847. X!           mrg_to_wielded = FALSE;
  1848. X            obj->quan = mergquan;
  1849. X          }
  1850. X          }
  1851. X***************
  1852. X*** 368,374 ****
  1853. X      if((obj->otyp == LOADSTONE) && obj->cursed) {
  1854. X          obj->bknown = 1;
  1855. X          pline("The stone%s won't leave your person.",
  1856. X!             obj->quan==1 ? "" : "s");
  1857. X          return(0);
  1858. X      }
  1859. X      /* Prohibit Amulets in containers; if you allow it, monsters can't
  1860. X--- 371,377 ----
  1861. X      if((obj->otyp == LOADSTONE) && obj->cursed) {
  1862. X          obj->bknown = 1;
  1863. X          pline("The stone%s won't leave your person.",
  1864. X!             plur((long)obj->quan));
  1865. X          return(0);
  1866. X      }
  1867. X      /* Prohibit Amulets in containers; if you allow it, monsters can't
  1868. X***************
  1869. X*** 407,413 ****
  1870. X      obj->nobj = fcobj;
  1871. X      fcobj = obj;
  1872. X  
  1873. X!     if(Icebox)    obj->age = moves - obj->age;    /* actual age */
  1874. X  
  1875. X      else if(Is_mbag(obj->cobj) &&
  1876. X          (Is_mbag(obj) ||
  1877. X--- 410,416 ----
  1878. X      obj->nobj = fcobj;
  1879. X      fcobj = obj;
  1880. X  
  1881. X!     if(Icebox) obj->age = monstermoves - obj->age; /* actual age */
  1882. X  
  1883. X      else if(Is_mbag(obj->cobj) &&
  1884. X          (Is_mbag(obj) ||
  1885. X***************
  1886. X*** 452,459 ****
  1887. X      dec_cwt(current_container, obj);
  1888. X      obj->cobj = (struct obj *) 0;
  1889. X  
  1890. X!     if (Icebox)
  1891. X!         obj->age = moves - obj->age;    /* simulated point of time */
  1892. X  
  1893. X      (void) addinv(obj);
  1894. X      return 0;
  1895. X--- 455,462 ----
  1896. X      dec_cwt(current_container, obj);
  1897. X      obj->cobj = (struct obj *) 0;
  1898. X  
  1899. X!     if (Icebox) obj->age = monstermoves - obj->age;
  1900. X!     /* simulated point of time */
  1901. X  
  1902. X      (void) addinv(obj);
  1903. X      return 0;
  1904. X
  1905. END_OF_FILE
  1906. if test 47374 -ne `wc -c <'patches04c'`; then
  1907.     echo shar: \"'patches04c'\" unpacked with wrong size!
  1908. fi
  1909. # end of 'patches04c'
  1910. fi
  1911. echo shar: End of archive 3 \(of 11\).
  1912. cp /dev/null ark3isdone
  1913. MISSING=""
  1914. for I in 1 2 3 4 5 6 7 8 9 10 11 ; do
  1915.     if test ! -f ark${I}isdone ; then
  1916.     MISSING="${MISSING} ${I}"
  1917.     fi
  1918. done
  1919. if test "${MISSING}" = "" ; then
  1920.     echo You have unpacked all 11 archives.
  1921.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1922. else
  1923.     echo You still need to unpack the following archives:
  1924.     echo "        " ${MISSING}
  1925. fi
  1926. ##  End of shell archive.
  1927. exit 0
  1928.